﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SwenAssignment3.Classes;

namespace SwenAssignment3.RoomAvailabilityCumBookingModule
{
    public partial class CheckOut : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            string roomNo = Request.QueryString["RoomNo"];
            Invoice inv = DRHotelDBManager.retrieveInvoiceByRoomNo(Convert.ToInt32(roomNo),DateTime.Now);
            int nights = DateTime.Now.Day - inv.CheckInDateTime.Day;
            Rooms room = DRHotelDBManager.RetrieveRoomByRoomNo(roomNo);
            lblCheckInDateTime.Text = Convert.ToString(inv.CheckInDateTime);
            lblNightStayed.Text = Convert.ToString(nights);
            lblPayment.Text = inv.PaymentMode;
            lblRoomRates.Text = Convert.ToString(room.RoomRates);
            lblAdditionalCost.Text = Convert.ToString(inv.AdditionalCost);
            lblTotalCost.Text = Convert.ToString(nights * room.RoomRates + inv.AdditionalCost);
            lblCheckOutDateTime.Text = Convert.ToString(DateTime.Now);
        }
    }
}